Poll question answers without rebuilding reviews - #16
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues were identified, and all reviewers assessed it as ready.
Review effort: Lite
Findings: None
What changed in this PR
This PR replaces full review rebuilds during question polling with lightweight persisted answer-status reads.
Changes:
- Adds SQLite-backed question status polling.
- Safely merges answer and active-state updates in the browser.
- Adds regression coverage and implementation documentation.
| File | Description |
|---|---|
web/server.ts |
Provides lightweight question status polling. |
web/public/app.js |
Merges polling updates without replacing review metadata. |
test/browser/review.spec.ts |
Verifies polling efficiency and Refresh behavior. |
docs/implementation/read-only-review.md |
Documents the polling design and guarantees. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Answer polling currently calls
ReviewService.load()every two seconds, rebuilding Git history, linkage, previews, and the review token just to observe a persisted agent attempt.Read question answer state directly from SQLite and add the question manager's in-memory active marker. Poll responses contain only note IDs, answer state, and active state. The browser merges those fields into notes already owned by the displayed review, so polling cannot replace snapshot, plan, assignment, reference-validity, ordering, or text metadata. The existing generation guard continues to reject polls started before an action or Refresh.
Before/after: the focused browser regression measured one full review load for a single poll before this change and zero afterward. It also observes the completed answer in the UI and SQLite, confirms the polling payload omits note text, and proves explicit Refresh still performs a full load.
Validation at exact head
885cf09: typecheck, 188 unit/integration tests, and 39 browser tests pass locally. Both CI runs pass.Review-lesson audit
885cf09; no new rule is required.Deferred: #10 review-summary edge cases and #3's human go/no-go experiment remain separate work.
Closes #12.